// 导入包
const express = require("express");

// 创建对象
const app = express();

// 创建路由
app.get("/home", (req, res) => {
  res.end("homepage");
});

app.post("/login", (req, res) => {
  res.end("login...login");
});

app.all("/test", (req, res) => {
  res.end("test...test");
});

app.all("/*", (req, res) => {
  res.end("404 Not Found");
});

// 监听端口，启动服务
app.listen(3000, () => {
  console.log("路由的使用……");
});
